home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / cat_exe.zip / RHOMB.CAR < prev    next >
Text File  |  1994-11-18  |  1KB  |  49 lines

  1. (* Program creates rhombic shapes by aid of the 'XOR' operator. *)
  2. (*                                                              *)
  3.  
  4. RECIPE  XYSize  =  80;
  5.         XYBound =  1;
  6.         Colors =  2;
  7.         Zet    = 2;
  8.  
  9. CONST Dead    =  0;
  10.       Alive   =  1;
  11. VAR x;
  12.  
  13. REF   right          [1,0];
  14.       left           [-1,0];
  15.       top            [0,-1];
  16.       bottom         [0,1];
  17.       bottom_right   [1,1];
  18.       bottom_left    [-1,1];
  19.       top_right      [1,-1];
  20.       top_left       [-1,-1];
  21.  
  22. EVENT SetUp;
  23.    RingForm;
  24.    PlClipAll;
  25.    RGBPalette(Colors, $0, $FF, $32,0, $B6,0);
  26.    ShowPlane;
  27.  
  28.  
  29. EVENT E1;(* initialization of the cells *)
  30.      PARALLEL DO
  31.        x := Random (1000);
  32.        IF  (x > 998)
  33.            THEN Self := Alive;
  34.            ELSE Self := Dead;
  35.        FI;
  36.      OD;
  37.      ShowPlane;
  38.  
  39. EVENT E2;
  40.     PARALLEL DO
  41.        IF Self = Alive
  42.        THEN Self := Alive;
  43.        ELSE Self :=  Self XOR (right OR left OR top OR bottom);
  44.        FI;
  45.     OD;
  46.     ShowPlane;
  47. END.
  48.  
  49.